<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/WEB-INF/tld/jmesa.tld" prefix="jmesa" %> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   
    <title>My JSP 'list_user.jsp' starting page</title>
    <script type="text/javascript" src="/estate/js/jquery-1.2.2.pack.js"></script>
    <script type="text/javascript" src="/estate/js/jquery-1.3.min.js"></script> 
    <script type="text/javascript" src="/estate/js/jquery.jmesa.js"></script>
    <script type="text/javascript" src="/estate/js/jmesa.js"></script>              
    <link rel="stylesheet" type="text/css" href="/estate/css/jmesa.css"></link>
    <script type="text/javascript">
    	function selectAllItens(tid) {
    		alert("enter");
		    var table = document.getElementById(tid);
		    var inputs = table.getElementsByTagName("input");
		    var inputOption = inputs[0];
		    //begin on 1 to ignore the header checkbox and count only theother ones on the table
		    for (var i = 1; i < inputs.length; i++){
		   	 	alert("enter"+i);
		   	 	inputOption.checked = true;
		        inputs[i].checked = inputOption.checked;
		        inputs[i].onclick();
		    }

		} 
    </script>
    
  </head>
 
  <body>
  <form id="testForm"  name="testForm" action="testAction.action?method=list" method="post">
      <jmesa:struts2TableModel items="${testList}" id="user_table" var="bean" stateAttr="restore" editable="true" exportTypes="jexcel"  toolbar="com.estate.utils.JmesaToolBarPage">
          <jmesa:htmlTable width="600" caption="用户信息">
              <jmesa:htmlRow uniqueProperty="id">
              	  <jmesa:htmlColumn property="chkbox" title="&nbsp;" worksheetEditor="org.jmesa.worksheet.editor.CheckboxWorksheetEditor" sortable="false"/>
              	  <jmesa:htmlColumn style="visibility:hidden;" property="checnbox" title="<input type='checkbox'/>"><input type="checkbox"/></jmesa:htmlColumn>
                  <jmesa:htmlColumn property="id" editable="false"/>
                  <jmesa:htmlColumn property="test" sortable="true"/>
                  <jmesa:htmlColumn property="testDate" sortable="true"/>
                  <jmesa:htmlColumn><a href="">sdfsd${bean.id}</a></jmesa:htmlColumn>
              </jmesa:htmlRow>
          </jmesa:htmlTable>
      </jmesa:struts2TableModel>
  </form>
  <input type="button" onclick="selectAllItens('user_table')" value="全选"/>
  <a href="testCheckboxAction.action">测试复选框</a>
  <script type="text/javascript">
      function onInvokeAction(id){
      	  alert("onInvokeAction");
          $.jmesa.setExportToLimit(id,'');
          $.jmesa.createHiddenInputFieldsForLimitAndSubmit(id);
          alert("after onInvokeAction");
      }  
      function onInvokeExportAction(id) {
       		
			var parameterString = $.jmesa.createParameterStringForLimit(id);
			alert(parameterString);
			location.href = "testAction.action?method=export&" + parameterString;
      }
  </script>
  </body>
</html>